import { defineStore } from 'pinia'
import { AddressInfo,ReturnInfo } from '../@api/AddressInfo'
import { AddressInfoDirection } from '../type'


interface AddressInfoStates {
    addressEditParameter: {
        addressDirection: AddressInfoDirection | null
        // 编辑地址的信息
        addressInfo: AddressInfo | null,
        //地图回传信息
        returnInfo:ReturnInfo|null,
        onEditComplete?: (address: AddressInfo) => void
    }
}

const useAddressInfoStore = defineStore("addressInfo", {
    // 持久化存储插件其他配置
    state: (): AddressInfoStates => ({
        addressEditParameter: {
            addressDirection: null,
            // 编辑地址的信息
            addressInfo: null,
            returnInfo:null,
        },
    }),

    actions: {

    },

    getters: {

    },
})

export default useAddressInfoStore